package de.baumann.browser.adapter

import android.annotation.SuppressLint
import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import de.baumann.browser.R
import de.baumann.browser.api.net.vo.explore.OdinDestroyBean
import de.baumann.browser.api.net.vo.explore.OtherDestroyBean

class ExploreOtherDestroyRecordAdapter : BaseQuickAdapter<OtherDestroyBean, BaseViewHolder>(R.layout.item_other_destroy_record) {
    @SuppressLint("SetTextI18n")
    override fun convert(helper: BaseViewHolder, item: OtherDestroyBean) {
        var view = helper.getView<ImageView>(R.id. ivLogo)
        var name = helper.getView<TextView>(R.id.tvItemName)

        when (item.coinType) {
            "gung" -> {
                view.setImageResource(R.drawable.gung)
                name.text = "销毁Gung"
            }
            "frig" -> {
                view.setImageResource(R.drawable.frig)
                name.text = "销毁Fring"
            }
        }

        helper.setText(R.id.tvPowerAmount, "${item.power} 算力")
        helper.setText(R.id.tvDestroyTime, "${item.createTime} ")
    }
}